<?php if (!defined('THINK_PATH')) exit();?><!--style type="text/css">
.page .pageContent .bumen{width: 90%;position: relative;}
.page .pageContent .bumen span.error{position:absolute;right: 0px}
</style-->
<script type="text/javascript">
$(function(){
	$('.unit').on('change','.select',function(){
		var object=$(this);
		var id=$(this).val();if(id==0){object.nextAll().remove();return;}
		$.ajax({
			url:"<?php echo U('Member/getRole');?>",
			type:'post',
			data:{id:id},
			dataType:'json',
			success:function(data){
				object.nextAll().remove();
				if(data.length>0){
					object.removeClass('required');
					var html="<select class='select' name='auth[]'>";
					html+="<option value='0'>请选择</option>";
					for ( var i = 0; i < data.length; i++) {
						html+="<option value='"+data[i].id+"'>"+data[i].title+"</option>";
					}
					html+="</select>";
					//alert(html);
					object.parent().append(html);
				}
			}
		});
	});
})
</script>
<div class="page">
    <div class="pageContent">
        <form method="post" action="/Admin/Member/add" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)" >
        	<input type="hidden" name="id" value="<?php echo ($dataInfo['id']); ?>" />
            <div class="pageFormContent" layoutH="68">
				<input type="hidden" value="" id="types" name="sex">
				<?php if($opttype == ''): ?><div class="unit">
						<label>公司名称：</label>
						<input type="text" name="username" value="" username="username(element)" />
						<input type="hidden" name="type" value="1">
					</div>
				<?php else: ?>
					<div class="unit">
						<label>请选择网点：</label>
						<select name="network_id" class="required">
							<option value="">请选择</option>
							<?php if(is_array($notworkList)): $k = 0; $__LIST__ = $notworkList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$value): $mod = ($k % 2 );++$k;?><option value="<?php echo ($value["id"]); ?>"><?php echo ($value["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
						</select>
						<input type="hidden" name="type" value="4">
					</div><?php endif; ?>

	            <div class="unit">
	                <label>用户名：</label>
	                <input type="text" name="username" value="" class="required"  />
	            </div>
	            <div class="unit">
	                <label>手机号码：</label>
	                <input type="text" name="tel" value=""  class="required" />
	            </div>
				<div class="unit">
	                <label>密码：</label>
	                <input type="text" name="password" value=""  class="required"  />
	            </div>
				<?php if($opttype == ''): ?><div class="unit">
						<label>地址：</label>
						<input type="text" name="nickname" value=""  class="required"  />
					</div><?php endif; ?>				
            </div>
            <div class="formBar">
                <ul>
                     <li>
                        <div class="buttonSave">
                            <div class="buttonSaveContent">
                                <button type="submit">
                            		<i class="iconfont">&#xe644;</i>保存
                                </button>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="buttonCancel">
                            <div class="buttonCancelContent">
                                <button type="button" class="close">
                                	<i class="iconfont">&#xe640;</i>取消
                                </button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </form>
    </div>
</div>